import React, { useEffect } from 'react';
import './NavHome.scss'
import {userStore} from '../../store/index';
import { getStorage } from '../../util/storage';
import { createHashHistory } from 'history';
const history = createHashHistory();
export default function Tabs () {
    function goHome(){
        history.push('/')
    }
    useEffect(()=>{
        if(!userStore.getState().token && !getStorage('userToken')){
            history.push('/login')
        }
    },[])
    return(
        <div className="goHome" onClick={goHome}>
            <img src={ require('../../static/images/home.svg') }/>
        </div>
    )
}